Skip to content

docs(submitqueue): combine predictor into Scorer - #682

Open
behinddwalls wants to merge 5 commits into
mainfrom
preetam/outcome-predictor-rfc
Open

docs(submitqueue): combine predictor into Scorer#682
behinddwalls wants to merge 5 commits into
mainfrom
preetam/outcome-predictor-rfc

Conversation

@behinddwalls

@behinddwalls behinddwalls commented Sep 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

Why?

Ranking only needs one number per unresolved batch. A sibling Predictor factory duplicated the per-queue seam and made evidence look like a second public extension. The review asked for one ranking interface, framed as a logit-linear model.

What?

Scorer is the ranking extension: Score(ctx, batch, paths). Evidence is the default impl wrapping a nested base (heuristic or composite). YAML is type: evidence plus factors plus base. The revision is logit(p') = logit(p_base) + Σ w_i x_i with configured weights (w_i = log(factor_i)), not a fitted GLM.

Test Plan

Docs-only change.

Issues

## Summary

### Why?

Speculation ranks paths on the scorer's price, which only reflects the change (lines, files) and ignores what the run has since observed — a passed build, a failed build, batch state. The predictor design needs a written contract before the implementation lands.

### What?

Adds doc/rfc/submitqueue/outcome-predictor.md: scorer vs predictor, the four YAML factors and what their values mean, which path results count as evidence, and rejected alternatives. Links it from doc/rfc/index.md.

## Test Plan

Docs-only change.
## Summary

### Why?

The RFC's rejected-options list used implementation shorthand and included alternatives already explained elsewhere, making the design tradeoffs difficult to evaluate without branch context.

### What?

Keep the four alternatives reviewers are likely to raise and state each rejected option, why it fails, and the selected design. Remove redundant and scorer-specific entries.
@behinddwalls
behinddwalls force-pushed the preetam/outcome-predictor-rfc branch from 451805e to 3227132 Compare September 7, 2026 23:54
@behinddwalls
behinddwalls marked this pull request as ready for review September 8, 2026 00:08
@behinddwalls
behinddwalls requested review from a team and sbalabanov as code owners September 8, 2026 00:08
## Summary

### Why?

The outcome predictor RFC described failed-path evidence and ranking differently from the path-set identity and best-first behavior, while older speculation RFCs still assigned dynamic pricing to the scorer.

### What?

Document that prediction applies to unresolved dependencies, failed all-succeeds evidence applies once, neutral factors preserve exact scorer prices, and factors must be finite. Update the existing speculation RFCs to consistently describe predictor-based ranking and state-aware pricing.
Document per-queue factor inheritance and the shared batch/path-set snapshot consumed by best-first ranking.

@sbalabanov sbalabanov left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. Is predictor a first class abstraction (i.e. an interface) or implementation detail of the generator?
  2. Let's discuss as an alternative to have all the decisions inside scorer. Scorer is called for each batch anyways? Why can't be made evidence-aware?
  3. The proposed implementation of the predictor is somewhat hard to read. Can we frame it as a linear regression model with defined features and configured weights? What in the proposal does not fit into a definition of LGM?

Fold ranking into one Score(ctx, batch, paths). Evidence is the scorer; heuristic/composite are the nested base. Frame the revision as a configured logit-linear model.
@behinddwalls behinddwalls changed the title docs(submitqueue): add outcome predictor RFC docs(submitqueue): combine predictor into Scorer Sep 11, 2026
@behinddwalls

Copy link
Copy Markdown
Collaborator Author

Agreed on all three — the stack now does (1)+(2) as one Scorer, and (3) is documented on that impl.

  1. Scorer is the first-class ranking extension. Evidence is a scorer implementation wrapping a nested base, not a Generator private type and not a sibling Factory. bestfirst does not import a Predictor.

  2. One Score call. The contract is Score(ctx, batch, paths). Heuristic/composite ignore paths; evidence revises p_base from the path set and batch state. YAML is type: evidence + factors + base (heuristic/composite only under base).

  3. Logit-linear / GLM with configured weights: logit(p') = logit(p_base) + Σ w_i x_i, w_i = log(factor_i). Neutral 1 is w = 0. Weights are YAML, not trained; the epsilon clamp is numeric, not part of the linear predictor.

The rewrite is in this PR; impl / wiring / demo are #683, #684, #686.

@@ -0,0 +1,126 @@
# Outcome Scorer

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Predictor is gone, file name still specifies it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants